< previous page page_388 next page >

Page 388
Arguments
The copyFile method of the IFileSubsystem class accepts a String argument for the source file and a String argument for the destination to which the file is to be copied.
The deleteFile method of the IFileSubsystem class accepts a String argument for the file that is to be deleted.
The transferToFile method of the IFileSubsystem class accepts an RDO Resultset object from which to receive records to persist to file.
Practical Guidelines for Implementing the File Operations Subsystem
In most of your applications, you're not going to need all of the GeneralFile family of classes. It is likely that you'll need at most two, with the RichTextFile class more likely. The IPersistence class will be quite busy if your application uses both database information and file information; however, in most cases, your application will only use one or the other.
Incorporating the File Operations Subsystem into the Samsona Bank Teller System Example
The branch manager at the Second Bank of Carrollton instructed you that she needs only a bank teller transaction file to record every withdrawal and deposit process each teller performs. Thus, in the deposit method of the DepositFunds class and the withdraw method of the WithdrawFunds class, the following steps must be completed upon the successful completion of these transactions:
1. Declare a Transaction object, theTransaction, as Public in the class TransactionProcessor.
2. Declare four global constants for the transaction IDs in the modMain module:
9f8044bafea36a1f728739c0bb58ef4c.gif
Public Const OPENNEWACCOUNT As Long = 100001
Public Const CLOSEACCOUNT As Long = 100002
Public Const DEPOSITFUNDS As Long = 100003
Public Const WITHDRAWFUNDS As Long = 100004
3. Invoke the add method of the AllTransactions instance, TransactionGroup.
4. In the terminateSystem method of the CApplication class, insert code to save the collection of Transaction objects to a file.

 
< previous page page_388 next page >

If you like this book, buy it!